class ApplicationController < ActionController::Base
  helper :application
    
  # See ActionController::RequestForgeryProtection for details
  # Uncomment the :secret if you're not using the cookie session store
  # protect_from_forgery # :secret => '31543c847ec4a5a44e4088697916c212'
  
  # Set the flash or flash.now appropriately for normal and AJAX requests
  # Force now with options[:now] => flash_message
  def set_flash(options={})
    now = options.delete(:now) || request.xhr?
    type, message = options.to_a.flatten
    if now
      flash.now[type] = message
    else
      flash[type] = message
    end
  end
end
